<?php if ($request == 'main_page'):?>
<!-- <div class="row media common"> -->
<script>
$(function() {
	$('#media_carousel').tinycarousel();
});
</script>
	<div class="span12 center-content">
		<div class="inner-content">
			<div id="media_carousel">
				<a class="buttons prev" href="#">《</a>
				<div class="viewport">
					<ul class="overview">
						<?php if ($content):?>
						<?php foreach ($content as $k => $v):?>
						<?php if ($k % 4 == 0):?><li><?php endif;?>
							<div id="<?php echo $v['id']?>" class="news">
								<img src="<?php echo $v['pic'][0]['thumb_path']?>">
								<div>
									<span class="detail-plus" data-toggle="modal" href="#media_modal" id="<?php echo $v['id']?>">+</span>
									<div id="title"><?php echo $v['name']?></div>
									<div id="sub_title" <?php if (empty($v['sub_title'])):?>style="visibility: hidden;"<?php endif;?>>
										<?php echo $v['sub_title'] ? $v['sub_title'] : 'null'?>
									</div>
									<div id="content"><p><?php echo ellipsize($v['content'], 100)?><p></div>
								</div>
							</div>
						<?php if ($k % 4 == 3):?></li><?php endif;?>
						<?php endforeach;?>
						<?php endif;?>
					</ul>
				</div>
				<a class="buttons next" href="#">》</a>
			</div>
		</div>
	</div>
	
	<div class="modal hide presentation" id="media_modal"></div>
<!-- </div> -->
<?php elseif ($request == 'sub_page'):?>
<script>
$(function() {
	
	<?php if ($this->common->_is_admin()):?>
	post_option['media_id'] = <?php echo $news['id']?>;
	<?php endif;?>
	
});
</script>
	<div id="pic">
		<?php if ($pic):?>
		<?php foreach ($pic as $k => $v):?>
		<?php if ($v['weight'] > 1 && $k <= 2):?>
		<img src="<?php echo $v['photo_path']?>">
		<?php endif;?>
		<?php endforeach;?>
		<?php endif;?>
	</div>
	<div class="modal-close" data-dismiss="modal">x</div>
	<div id="intro">
    	<div class="title"><?php echo $news['name']?></div>
    	<div class="sub_title" <?php if (empty($news['sub_title'])):?>style="visibility: hidden;"<?php endif;?>>
    		<?php echo $news['sub_title'] ? $news['sub_title'] : 'null'?>
    	</div>
    	<div class="content"><?php echo $news['content']?></div>
    </div>
<?php endif;?>
